package com.yvtian.pu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.pu.pojo.PuOrderShopEntity;
import com.yvtian.pu.dao.PuOrderShopMapper;
import com.yvtian.pu.service.PuOrderShopService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 采购单明细(pu_order_shop)表服务实现类
 *
 * @author long
 * @since 2024-06-24 10:26:28
 */
@Service("puOrderShopService")
public class PuOrderShopServiceImpl extends ServiceImpl<PuOrderShopMapper, PuOrderShopEntity> implements PuOrderShopService {

    @Override
    public IPage<PuOrderShopEntity> findByPage(Page<PuOrderShopEntity> page, PuOrderShopEntity puOrderShopEntity) {
        LambdaQueryWrapper<PuOrderShopEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(puOrderShopEntity.getOrderCode())) {
            queryWrapper.eq(PuOrderShopEntity::getOrderCode, puOrderShopEntity.getOrderCode());
        }
        return this.page(page, queryWrapper);
    }
}

